package com.jt.controller;

import com.jt.pojo.ItemCatParam;
import com.jt.service.ItemCatParamService;
import com.jt.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/itemCatParam")
public class ItemCatParamController {

    @Autowired
    private ItemCatParamService itemCatParamService;


    @RequestMapping("/findItemCatParamListByType")
    public SysResult findItemCatParamListByType(ItemCatParam itemCatParam)
    {
           List<ItemCatParam> itemCatParamList= itemCatParamService.findItemCatParamListByType(itemCatParam);
           return  SysResult.success(itemCatParamList);
    }

    @PostMapping("/addItemCatParam")
    public SysResult addItemCatParam(@RequestBody ItemCatParam  itemCatParam)
    {
        itemCatParamService.addItemCatParam(itemCatParam);
        return  SysResult.success();
    }

    @PutMapping("/updateItemCatParam")
    public  SysResult updateItemCatParam(@RequestBody ItemCatParam  itemCatParam)
    {
        itemCatParamService.updateItemCatParam(itemCatParam);
        return  SysResult.success();
    }

    @DeleteMapping("/deleteItemCatParamById")
    public  SysResult deleteItemCatParamById(Integer paramId)
    {
        itemCatParamService.deleteItemCatParamById(paramId);
        return  SysResult.success();
    }


}
